﻿<phone:PhoneApplicationPage 
    x:Class="MM.Translator.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:System="clr-namespace:System;assembly=mscorlib" xmlns:Controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit" mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="696"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    shell:SystemTray.IsVisible="True">
        <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot" Background="Transparent">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <!--TitlePanel contains the name of the application and page title-->
        <StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28">
            <TextBlock x:Name="ApplicationTitle" Text="Universal Translator" Style="{StaticResource PhoneTextNormalStyle}"/>
            <TextBlock x:Name="PageTitle" Text="Translate" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}"/>
        </StackPanel>

        <!--ContentPanel - place additional content here-->
        <Grid x:Name="ContentPanel" Grid.Row="1" >
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="*" />
            </Grid.RowDefinitions>
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*" />
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition Width="*" />
                </Grid.ColumnDefinitions>
                <Controls:ListPicker x:Name="listPickerSourceLanguage" Header="Source" Grid.Column="0" >
                    <Controls:ListPicker.ItemTemplate>
                        <DataTemplate>
                            <StackPanel Orientation="Horizontal">
                                <TextBlock Text="{Binding Path=Name}" Margin="2 0 0 0" FontSize="22"/>
                            </StackPanel>
                        </DataTemplate>
                    </Controls:ListPicker.ItemTemplate>
                    <Controls:ListPicker.FullModeItemTemplate>
                        <DataTemplate>
                            <StackPanel Orientation="Horizontal" Margin="16 21 0 20">
                                <Rectangle Fill="White" Width="43" Height="43"/>
                                <TextBlock Text="{Binding Path=Name}" Margin="16 0 0 0" FontSize="43" FontFamily="{StaticResource PhoneFontFamilyLight}"/>
                            </StackPanel>
                        </DataTemplate>
                    </Controls:ListPicker.FullModeItemTemplate>
                </Controls:ListPicker>
                <Button Click="OnReverse" Width="80" Height="76" VerticalAlignment="Bottom" Grid.Column="1">
                    <Button.Content>
                        <Image Source="/MM.Translator;component/Images/reverse.png" />
                    </Button.Content>
                </Button>
                <Controls:ListPicker x:Name="listPickerTargetLanguage" Header="Target" Grid.Column="2">
                    <Controls:ListPicker.ItemTemplate>
                        <DataTemplate>
                            <StackPanel Orientation="Horizontal">
                                <TextBlock Text="{Binding Path=Name}" Margin="2 0 0 0" FontSize="22"/>
                            </StackPanel>
                        </DataTemplate>
                    </Controls:ListPicker.ItemTemplate>
                    <Controls:ListPicker.FullModeItemTemplate>
                        <DataTemplate>
                            <StackPanel Orientation="Horizontal" Margin="16 21 0 20">
                                <Rectangle Fill="White" Width="43" Height="43"/>
                                <TextBlock Text="{Binding Path=Name}" Margin="16 0 0 0" FontSize="43" FontFamily="{StaticResource PhoneFontFamilyLight}"/>
                            </StackPanel>
                        </DataTemplate>
                    </Controls:ListPicker.FullModeItemTemplate>
                </Controls:ListPicker>
            </Grid>
            <StackPanel Orientation="Horizontal" Grid.Row="1" HorizontalAlignment="Stretch">
                <TextBox x:Name="TextBoxText" Height="134" Width="324" AcceptsReturn="True" VerticalScrollBarVisibility="Auto" TextWrapping="Wrap" />
                <Button Content="Translate" Click="OnTranslate"></Button>
            </StackPanel>
            <TextBox x:Name="TextBoxResult" Grid.Row="3" AcceptsReturn="True" VerticalScrollBarVisibility="Auto" TextWrapping="Wrap" IsReadOnly="True" Margin="0,0,0,6" Grid.RowSpan="3" />
        </Grid>
    </Grid>
 
    <!--Sample code showing usage of ApplicationBar-->
    <phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar IsVisible="True" IsMenuEnabled="True">
            <shell:ApplicationBarIconButton IconUri="/Images/about.png" Text="About" Click="OnApplicationSetting"/>
        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>

</phone:PhoneApplicationPage>